1. Field of the Invention
The present invention relates to a compression method and device, a decompression method and device, a compression/decompression system, a peak detection method, program and a recording medium and, in particular, to a compression and decompression system of continuous analog signals or digital signals.
2. Description of the Related Art
Conventionally, in case of transmitting or accumulating a signal with a large amount of information such as an image signal or a voice signal, the signal is compressed and decompressed for the purpose of reducing an amount of transmitted information and extending savable time in an accumulating medium. In general, in case of compressing an analog signal, first, the analog signal is sampled in accordance with a predetermined sampling frequency to be digitized, and obtained digital data is subjected to compression processing.
For example, in compression of an image signal or a voice signal, a method of performing compression in a frequency area after processing original data using a conversion filter of time axisxe2x80x94frequency axis such as DCT (Discrete-Cosine-Transform). DPCM (Differential Pulse Code Modulation) often used in a telephone line as a compression system of a voice signal is also used aiming at this point. Further, this compression system by DPCM is a system for coding a differential of neighboring sample values when a waveform is sampled.
In addition, as a system for performing time/frequency conversion, there is also a system using a sub-band filter or MDCT (Modified Discrete Cosine Transform). There is an MPEG (Moving Picture Image Coding Experts Group) audio such as MP3 or AAC as a coding system using such a system. Recently, compression systems such as ATRAC (Adaptive Transform Acoustic Coding), TwinVQ, WMA (Windows Media Audio) and Dolby Digital(copyright) (AC-3) have been widely used.
In addition, a compression system of an image most widely used is generally known as this MPEG standard as well.
Decompression processing of data compressed in accordance with the above-described compression system is basically performed by an opposite operation of the compression processing of the same compression system.
That is, compressed digital data is subjected to predetermined decompression processing after being converted from a signal of a frequency area to a signal of a time area by means of frequency-to-time conversion, whereby original digital data is reproduced. Then, the original data found in this way is digital-analog converted according to necessity and outputted as an analog signal.
In general, in considering compression and decompression of data, it is an important subject to find how to improve a quality of reproduced data while increasing a compression ratio. However, in the above-described conventional compression/decompression system, there is a problem in that, when it is attempted to increase a compression ratio of an image signal or a voice signal, a quality of an image or a voice that is reproduced by decompressing compression data is deteriorated and, conversely, when importance is attached to a quality of a reproduced image or a reproduced voice, a compression ratio of an image signal or a voice signal decreases. Thus, it is extremely difficult to realize both improvement of a compression ratio and improvement of a quality of reproduced data.
In addition, in the above-described conventional compression/decompression system, since a signal on a time axis is converted to a signal on a frequency axis to be compressed, processing such as time/frequency conversion in compression and frequency/time conversion in decompression becomes necessary. Thus, there is a problem in that processing becomes complicated and, at the same time, a structure for realizing this becomes extremely complicated. This is a factor for extending a processing time required for compression and decompression and making miniaturization of an apparatus difficult.
The present invention has been devised in order to solve such problems, and it is an object of the present invention to provide a completely new compression/decompression system that realizes both improvement of a compression ratio and improvement of a quality of reproduced data.
In addition, it is another object of the present invention to make it possible to simplify compression/decompression processing of signals to reduce processing time and, at the same time, also simplify a configuration for realizing this.
In order to solve the above-described subject, in a compression side of the present invention, with respect to data having periodicity to be compressed, windows of the same size are set for every plurality of sections according to a period of the data, processing for sorting sample data alternately among the set windows of the same size is sequentially performed, and compression processing is applied to data obtained by the sorting processing, whereby compression data is obtained.
In addition, on a decompression side of the present invention, decompression processing opposite to the compression processing is applied to the compression data, the same windows as described above are set for data obtained by the decompression processing, and processing for resorting data alternately among the set windows of the same size is sequentially performed, whereby decompression data is obtained.
In addition, in a peak detection method of the present invention, with respect to data having periodicity in which peaks appear substantially periodically, a maximum value of data in a first section existing before a certain sampling point inclusive (pre-maximum value) and a maximum value of data in a second section existing after the above-mentioned sampling point inclusive (post-maximum value) are detected and, if a data value of the above-mentioned sampling point, the above-mentioned pre-maximum value and the above-mentioned post-maximum value are coincide with each other, the above-mentioned sampling point is detected as a peak.
Since the present invention consists of the above-mentioned technical means, a frequency of data having periodicity is replaced with a lower frequency by the sorting processing, and the compression processing is applied to the replaced data. The sorting processing has no loss at all because an order of data is simply sorted and has 100% reproducibility. Therefore, in particular, the present invention is preferably applied to compression processing having a characteristic that a compression ratio is not increased when a high-frequency signal is compressed. In addition, it becomes possible to increase a compression ratio without damaging reproducibility to original data at all even if the compression processing is not changed as it is.
In another aspect of the present invention, as an example of the above-mentioned compression processing, processing is performed in which sampling points where, after performing the above-described sorting processing, when data between two sampling points is subjected to linear interpolation with respect to data obtained by the sorting processing, an error between interpolated data and original data is up to a desired value are sequentially detected as sample points of compression data.
In this case, a large number of sample data included in the sorted data have sample points where a small error between interpolated data and original data is detected, even if simple linear interpolation is performed at the time of decompression processing. Then, only discrete amplitude data in each sample point, timing data representing a time interval between respective sampling points, and the like are generated as compression data. Thus, it becomes possible to realize a high compression ratio while favorably maintaining reproducibility of original data by decompression.
In particular, according to the present invention, even if data with a high frequency, that is, data in which a data value changes relatively largely even in adjacent sampling points is compressed, the above-described detection processing of sample points is performed after the frequency is lowered by sorting of the data. Thus, it becomes possible to reduce the number of sample points to be detected as much as possible. It also becomes possible to realize a higher compression ratio while maintaining a quality of data to be reproduced by decompression high.
In addition, according to the present invention, when a signal on a time axis is compressed, it becomes possible to apply compression processing to the signal as it is on the time axis without performing time/frequency conversion to apply the compression processing to the signal on a frequency axis. Further, when the data compressed in this way is decompressed, it becomes possible to apply decompression processing to the data as it is on the time axis. In particular, on the decompression side, it becomes possible to reproduce highly precise decompression data that is almost the same as original data before compression simply by performing interpolation processing and extremely simple processing of sorting of data.
In addition, according to the peak detection method of the present invention, even if a data value of a certain sampling point is larger than a data value proximate to it and looks as if it is a peak at a glance, the sampling point is not detected as a peak if a larger data value exists in predetermined sections in front and behind the sampling point. The data value is detected as a peak only when each maximum value in the predetermined sections and a data value of a present sampling point coincide with each other. Consequently, it becomes possible to accurately detect only a true peak having a data value extremely large compared with other peaks with respect to a signal in which a data value has a peak locally while oscillating up and down.
In another aspect of the present invention, a predetermined section in which a post-maximum value is detected is set larger than a predetermined section in which a pre-maximum value is detected. Alternatively, a predetermined section in which a pre-maximum value is detected is set larger than a predetermined section in which a post-maximum value is detected. Consequently, it becomes possible to more accurately detect only a true peak having a data value extremely large compared with other peaks with respect to a signal in which a data value has a peak locally while oscillating up and down.